package com.hvgroup.modules.sanic.domain.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum ChartTypeEnum {

    TABLE_CHART("response_table", "表格", "temp01"),
    PIE_CHART("response_pie_chart", "饼图", "temp02"),
    BAR_CHART("response_bar_chart", "柱状图", "temp03"),
    LINE_CHART("response_line_chart", "折线图", "temp04");

    private final String code;
    private final String type;
    private final String templateCode;

    public static ChartTypeEnum getEnumByCode(String code) {
        for (ChartTypeEnum value : ChartTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
//        throw new IllegalArgumentException("Unsupported chart type: " + code);
        return ChartTypeEnum.TABLE_CHART;
    }
}